package table;

import javax.swing.JScrollPane;
import javax.swing.table.DefaultTableModel;

import models.TableSelectionModel;
import quary.QuaryBridge;

public class RentedView extends AbstractTable {

	private static final long serialVersionUID = 1L;

	private static final String[] COLUMN_IDENTIFIERS = {
		"Vinyl ID",
		"Arist",
		"Album",
		"Levering",
		"Eier ID",
		"Navn",
	};

	private QuaryBridge quaryBridge;
	
	public RentedView(JScrollPane contentPane, QuaryBridge quaryBridge) {
		super(contentPane);
		
		this.quaryBridge = quaryBridge;
		this.setTableModel(new DefaultTableModel());
		this.setListSelectionModel(new TableSelectionModel(this));
	}
	
	@Override 
	public void activate() {
		super.activate();
		
		this.populate();
	}
	
	public void deactivate() {
		super.deactivate();
	}
	
	@Override
	protected void populate() {
		this.setData(this.quaryBridge.getRentedList(), COLUMN_IDENTIFIERS);
	}
	
	public int getTableID() {
		return AbstractTable.BORROWED_VIEW;
	}
	
	@Override
	protected Object[] getDataAtRow(int row) {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public int insertLastRowToDatabase() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteSelectedRowsFromDatabase() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateRowInDatabase(int row) {
		// TODO Auto-generated method stub
		return 0;
	}
}
